frequency of character in a given string in c